package com.ihcil.forecast.demo.config;

import com.ihcil.forecast.demo.listenser.FileListener;
import com.ihcil.forecast.demo.listenser.FileMonitor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * Create by @baseException on 2022/11/4 9:40
 */


@Slf4j
@Component
public class InitRunner implements CommandLineRunner {
    @Autowired
    private FileMonitor fileMonitor;
    @Autowired
    private FileListener fileListener;

    @Override
    public void run(String... args) throws Exception {
//        System.out.println("读取String数组参数初始化操作内容...");
        String[] path = {"E:\\ifstartjustcarryon\\RadarPred\\datas\\", "E:\\ifstartjustcarryon\\RadarPred\\data0\\",
                "E:\\ifstartjustcarryon\\RadarPred\\data6\\", "E:\\ifstartjustcarryon\\RadarPred\\data12\\"};
        fileMonitor.monitor(path, fileListener);
        fileMonitor.start();
//        Thread t = new Thread(fileMonitor);
//        t.start();

    }
}

